

function showMenu(id) {
	var obj = $("#" + id);
	var objOffset = obj.offset();
	$("#treeDiv").css({width:obj.width()+ 26 + "px" ,left:objOffset.left + "px", top:objOffset.top + obj.outerHeight() + "px"}).slideDown("fast");
	$("body").bind("mousedown", onBodyDown);
}


function onBodyDown(event) {
	if (!(event.target.id == "treeDiv" || event.target.id == "treeDiv" || $(event.target).parents("#treeDiv").length>0)) {
		hideMenu();
	}
}


function hideMenu() {
	$("#treeDiv").fadeOut("fast");
	$("body").unbind("mousedown", onBodyDown);
}


